#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
int s(int a, int b)
{
    int k = 0;

    while (k = a % b)
    {
        a = b;
        b = k;
    }
    return b;
}
long long l(int a, int b)
{
    long long i = (a > b) ? a : b;
    while (1)
    {
        if (i % a == 0 && i % b == 0)
        {
            return i;
            break;
        }
        i++;
    }
}
int main()
{
    int a = 0;
    int b = 0;
    scanf("%d %d", &a, &b);
    long long sum = s(a, b) + l(a, b);
    printf("%lld", sum);
    return 0;
}